let loading = false;
Component({
  options: {
    addGlobalClass: true
  },
  properties: {
    message: String,
    time: {
      type: Number,
      value: 2000
    },
    status: String,
    show: Boolean
  },

  data: {

  },

  methods: {
    setShow() {
      if (loading) {
        return
      }
      loading = true;
      try {
        const {
          time
        } = this.data;
        this.setData({
          show: true,
        })
        setTimeout(() => {
          this.setData({
            show: false,
          })
          loading = false;
          this.triggerEvent("end")
        }, time)
      } catch {
        loading = false;
      }
    }
  }
})